package com.zc.demo.mapper;

import com.zc.demo.model.BookInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BookMapper {
    //添加图书
    @Insert("insert into book_info (book_name,author,count,book_types,price,book_desc,publish,status) "+
            "values (#{bookName},#{author},#{count},#{bookTypes},#{price},#{bookDesc},#{publishName},#{status})")
    Integer insertBook(BookInfo bookInfo);

    //显示图书
    @Select("select book_name,author,count,book_types,price,book_desc,publish,status from book_info")
    List<BookInfo> queryAll();
}
